package br.com.sgac.remote{


	import br.com.sgac.objetos.Clinica;
	import br.com.sgac.objetos.Funcionario;
	import br.com.sgac.objetos.Medicamento;
	
	import flash.utils.ByteArray;
	
	import mx.controls.Alert;
	import mx.rpc.AsyncToken;
	import mx.rpc.Responder;
	import mx.rpc.events.FaultEvent;
	import mx.rpc.remoting.mxml.RemoteObject;
	
	public class Remote {

		public var _remote:RemoteObject;
		public static var _instance:Remote;
		
		public function Remote(){
			_remote = new RemoteObject();
			_remote.showBusyCursor = true;
			_remote.destination = 'zend';
			_remote.endpoint = "http://{server.name}:{server.port}/sgac-php/server.php";
			
		}
		
		public function defaultFaultHandler(e:FaultEvent):void{
			Alert.show(e.message.toString(),e.fault.faultString);
		}
		public static function getInstance():Remote{
			if(_instance == null){
				_instance = new Remote();
			}
			return _instance;
		}
		
	}
}